/**
 * Created by cacalot123 on 2016/4/29.
 */
(function($) {
    "use strict";
    var $card = $("#card"),
        $sButton = $("#sButton");
    //表带卡号验证
    var payForm = function(){
        $card.on("keyup blur",function(){
            var $self = $(this),
                $errorTips = $self.next(".error-tips");
            var reg = /^\d{19}$/g;
                if( !reg.test($self.val()) ) {
                    $errorTips.html("格式应该为19位数字");
                }
                else {
                    $errorTips.html("");
                }
        })
        $sButton.on("click",function(){
            $card.blur();
            return false;
        })
    }
    payForm();


})(jQuery);